
import com.alibaba.fastjson.JSON;
import com.iohao.game.action.skeleton.core.DataCodecKit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.server.GameApplication;
import org.server.common.RedisUtil;
import org.server.config.RedisConfig;
import org.server.domain.Login.MyAttachment;
import org.server.domain.Result.Msg;
import org.server.domain.Room.Poker;
import org.server.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;

@SpringBootTest(classes = GameApplication.class)
@RunWith(SpringRunner.class)
public class test {
    @Autowired
    private RoomService roomService;
    @Autowired
    private RedisUtil redisUtil;

    @Test
    public void test() {
        System.out.println(redisUtil.getValueInHash("4367d", "current"));
    }

    @Test
    public void test01() {
        Poker poker = new Poker();
        poker.setRoomName("4367d");
        poker.setFakePoker("[2,2,2]");
        poker.setRealPokers("[1,2,3]");
        roomService.play(poker, 4L);
    }

    @Test
    public void name() {
        byte[] bytes = new byte[]{10, 66, 123, 34, 117, 115, 101, 114, 65, 99, 99, 111, 117, 110, 116, 34, 58, 34, 49, 49, 57, 52, 53, 57, 51, 52, 57, 49, 34, 44, 34, 117, 115, 101, 114, 73, 100, 34, 58, 49, 44, 34, 117, 115, 101, 114, 78, 105, 99, 107, 78, 97, 109, 101, 34, 58, 34, -27, -108, -112, -27, -65, -96, -26, -108, -65, 34, 125};
        System.out.println(DataCodecKit.decode(bytes, Msg.class));
    }
}
